package util.enumhelper;


import util.enumeration.Language;
import util.enumeration.OperatingDay;

public class LocalizedOperatingDay {

    // alphabetical order
    public static String getLocalizedOperatingDayAsString(OperatingDay operatingDay, String locale) {
        String localizedOperatingDay = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocale(Language.ENGLISH_US))) {
            localizedOperatingDay = getOperatingDay_EN_US(operatingDay);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocale(Language.ENGLISH_SINGAPORE))) {
            localizedOperatingDay = getOperatingDay_EN_SG(operatingDay);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocale(Language.MALAY))) {
            localizedOperatingDay = getOperatingDay_MS_MY(operatingDay);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocale(Language.CHINESE_CHINA))) {
            localizedOperatingDay = getOperatingDay_ZH_CN(operatingDay);
        }
        // other language...
        else {
            localizedOperatingDay = getOperatingDay_EN_US(operatingDay);
        }
        
        return localizedOperatingDay;
    }
    
    // simplified chinese (zh_CN)
    private static String getOperatingDay_ZH_CN(OperatingDay operatingDay) {
        String localizedOperatingDay = "";
        
        switch (operatingDay) {
            case MONDAY: localizedOperatingDay = "星期一" ; break;
            case TUESDAY: localizedOperatingDay = "星期二"; break;
            case WEDNESDAY: localizedOperatingDay = "星期三"; break;
            case THURSDAY: localizedOperatingDay = "星期四"; break;
            case FRIDAY: localizedOperatingDay = "星期五"; break;
            case SATURDAY: localizedOperatingDay = "星期六"; break;
            case SUNDAY: localizedOperatingDay = "星期日"; break;
         }
        return localizedOperatingDay;
    }
    
    // default (en_US)
    private static String getOperatingDay_EN_US(OperatingDay operatingDay) {
        String localizedOperatingDay = "";
        
        switch (operatingDay) {
            case MONDAY: localizedOperatingDay = "MONDAY" ; break;
            case TUESDAY: localizedOperatingDay = "TUESDAY"; break;
            case WEDNESDAY: localizedOperatingDay = "WEDNESDAY"; break;
            case THURSDAY: localizedOperatingDay = "THURSDAY"; break;
            case FRIDAY: localizedOperatingDay = "FRIDAY"; break;
            case SATURDAY: localizedOperatingDay = "SATURDAY"; break;
            case SUNDAY: localizedOperatingDay = "SUNDAY"; break;
         }
        return localizedOperatingDay;
    }
    
    // singapore english (en_SG)
    private static String getOperatingDay_EN_SG(OperatingDay operatingDay) {
        String localizedOperatingDay = "";
        
        switch (operatingDay) {
            case MONDAY: localizedOperatingDay = "MONDAY" ; break;
            case TUESDAY: localizedOperatingDay = "TUESDAY"; break;
            case WEDNESDAY: localizedOperatingDay = "WEDNESDAY"; break;
            case THURSDAY: localizedOperatingDay = "THURSDAY"; break;
            case FRIDAY: localizedOperatingDay = "FRIDAY"; break;
            case SATURDAY: localizedOperatingDay = "SATURDAY"; break;
            case SUNDAY: localizedOperatingDay = "SUNDAY"; break;
         }
        return localizedOperatingDay;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getOperatingDay_MS_MY(OperatingDay operatingDay) {
        String localizedOperatingDay = "";
        
        switch (operatingDay) {
            case MONDAY: localizedOperatingDay = "isnin" ; break;
            case TUESDAY: localizedOperatingDay = "Selasa"; break;
            case WEDNESDAY: localizedOperatingDay = "rabu"; break;
            case THURSDAY: localizedOperatingDay = "Khamis"; break;
            case FRIDAY: localizedOperatingDay = "Jumaat"; break;
            case SATURDAY: localizedOperatingDay = "Sabtu"; break;
            case SUNDAY: localizedOperatingDay = "Ahad"; break;
         }
        return localizedOperatingDay;
    }
    
//     
//    private static String getOperatingDay_XX_XX(OperatingDay operatingDay) {
//        String localizedOperatingDay = "";
//        
//        switch (operatingDay) {
//            case MONDAY: localizedOperatingDay = "星期一" ; break;
//            case TUESDAY: localizedOperatingDay = "星期二"; break;
//            case WEDNESDAY: localizedOperatingDay = "星期三"; break;
//            case THURSDAY: localizedOperatingDay = "星期四"; break;
//            case FRIDAY: localizedOperatingDay = "星期五"; break;
//            case SATURDAY: localizedOperatingDay = "星期六"; break;
//            case SUNDAY: localizedOperatingDay = "星期日"; break;
//         }
//        return localizedOperatingDay;
//    }
}
